package com.travel.goods.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.travel.entity.dto.ListResultVO;
import com.travel.entity.dto.ResultVO;
import com.travel.entity.goodsEn.TravelGoods;
import com.travel.goods.service.ITravelGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author muzi
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/goods/travel-goods")
public class TravelGoodsController {

    @Autowired
    private ITravelGoodsService iTravelGoodsService;

    /**
     * 根据旅游类型 查询商品（门票）
     * @param typeId
     * @return
     */
    @GetMapping("/findByTypeId/{typeId}")
    public ResultVO findListByTypeId(@PathVariable String typeId){

       return iTravelGoodsService.findListByTypeId(typeId);
    }


    /**
     * 根据商户id 获取商品列表
     * @param shopId
     * @return
     */
    @GetMapping("/findListByShopId/{shopId}")
    public ListResultVO findListByShopId(@PathVariable String shopId){

        return iTravelGoodsService.findListByShopId(shopId);
    }


    /**
     * 获取商品的所有属性
     * @return
     */
    @RequestMapping("/findAllGoods")
    public ResultVO findAllGoods(){

        return iTravelGoodsService.findAllGoods();
    }


    /**
     * 根据supId查询所有的表的信息
     * @param supId
     * @return
     */
    @GetMapping("/findListBySpuId/{supId}")
    public List<TravelGoods> findListBySpuId(@PathVariable String supId){

        return iTravelGoodsService.findListBySpuId(supId);
    }




}
